<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover" />
    <title>企业VIP开通</title>
    <link rel="stylesheet" href="{{asset('/addons/jquery-weui-build/css/weui.min.css')}}">
    <link rel="stylesheet" href="{{asset('/addons/jquery-weui-build/css/jquery-weui.css')}}">
    <link rel="stylesheet" href="{{asset('/css/system/iconfont.css')}}">
    @if($skinid == 3)
        <link rel="stylesheet" href="/css/system/common.css">
    @elseif($skinid == 1)
        <link rel="stylesheet" href="/css/theme-blue/system/common.css">
    @elseif($skinid == 2)
        <link rel="stylesheet" href="/css/theme-pink/system/iconfont-pink.css">
        <link rel="stylesheet" href="/css/theme-pink/system/common.css">
    @endif
    <link rel="stylesheet" href="/css/system/buy-vip.css">
    @include('sysadmin.head')
</head>
<body ontouchstart>
<div class="mian-container">
         @if($is_weixin)
        <form class="buy-vip" method="post" action="http://www.cimo.cn/wechatjspay">
            @else
        <form class="buy-vip" method="post" action="/wechat_h5_pay">
            @endif
        <div class="weui-cells user-show">
            <div class="weui-cell">
                <div class="weui-cell__hd"><img src="{{userlogo($user->id)}}"></div>
                <div class="weui-cell__bd">
                    <p>{{$user->qw_name}}</p>
                </div>
                <div class="weui-cell__ft">{{$company->expire_at}} 会员到期</div>
            </div>
        </div>
        <p class="title-p">1.开通企业VIP</p>
        <div class="weui-flex kind-cost">
            <div class="weui-flex__item">
                <div class="box-border">
                    <img class="buy-car" src="/img/buy-car.png">
                    <i class="weui-icon-success suc-icon active"></i>
                    <p><span data-price="1">888</span>元/年</p>
                    {{--<img src="/img/line.png">--}}
                    <p class="thin-p">标准版50人使用</p>
                </div>
            </div>
            <div class="weui-flex__item">
                <div class="box-border">
                    <i class="weui-icon-success suc-icon"></i>
                    <p><span data-price="2">1888</span>元/年</p>
                    <p class="thin-p">标准版150人使用</p>
                </div>
            </div>
            <div class="weui-flex__item">
                <div class="box-border">
                    <i class="weui-icon-success suc-icon"></i>
                    <p><span data-price="3">2888</span>元/年</p>
                    <p class="thin-p">标准版350人使用</p>
                </div>
            </div>
        </div>
        <input type="hidden" value="{{$user->id}}" name="user_id">
        <input type="hidden" value="{{$wechat_user['original']['openid']}}" name="openid">
        <input type="hidden" value="{{$user->corpid}}" name="corpid">
        <input type="hidden" value="{{$order_id}}" name="order_id">
        <input type="hidden" value="" name="price">
        <input type="hidden" value="" name="detail">
        <input type="hidden" value="" name="name">
        <p class="sum-up">应付金额：<span>888</span>元</p>
        <p class="title-p">2.选择支付方式</p>
        <div class="weui-cells pay-way">
            <div class="weui-cell">
                <div class="weui-cell__hd"><img src="/img/wechat.png"></div>
                <div class="weui-cell__bd">
                    <p>微信</p>
                </div>
                <div class="weui-cell__ft">
                    <i class="weui-icon-success active"></i>
                </div>
            </div>
        </div>
        <button type="submit" class="right-pay">立即支付</button>
    </form>
    <!-- 隐藏考核按钮部分-->
        @if($company->expire_at >= date('Y-m-d H:i:s',time()))
            @include('sysadmin.admin-caidan')
        @endif

</div>
<script src="{{asset('/kaohe/js/jquery-2.1.4.min.js')}}"></script>
<script src="{{asset('/addons/jquery-weui-build/js/fastclick.js')}}"></script>
<script>
    $(function() {
        document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
        FastClick.attach(document.body);
    });
</script>
<script src="{{asset('/addons/jquery-weui-build/js/jquery-weui.min.js')}}"></script>
<script>
    $(document).ready(function () {
        $('.kaohe-item').click(function(){
            $('.show-hidden').toggle();
        });
        $('.admin-item').click(function(){
            $('.front-show-hidden').toggle();
        });
        $('.box-border').each(function () {
            var that=this
            if($(that).find('i').hasClass('active')){
                $('input[name="price"]').val($(that).find('span').attr('data-price'));
                $('input[name="detail"]').val($(that).find('.thin-p').text());
                $('input[name="name"]').val($(that).find('span').text()+'元/年');
            }
        })
        $('.box-border').click(function () {
            $(this).parent().siblings().find('.suc-icon').removeClass('active');
            $(this).find('.suc-icon').addClass('active');
            $('input[name="price"]').val($(this).find('span').attr('data-price'));
            $('input[name="detail"]').val($(this).find('.thin-p').text());
            $('input[name="name"]').val($(this).find('span').text()+'元/年');
            $('.sum-up span').text($(this).find('span').text())
        })
        $('.pay-way').click(function () {
            $(this).find('i').toggleClass('active');
        })
//        数据提交
        $('.right-pay').click(function () {
            if(!$('.pay-way i').hasClass('active')){
                $.toast("请选择付款方式", "text");
                return false;
            }
            if($('input[name="price"]').val()==''||$('input[name="detail"]').val()==''||$('input[name="name"]').val()==''){
                $.toast("操作失败", "forbidden");
                return false;
            }
        })
    })
</script>
</body>
</html>